package com.maven.blog.mapper;


import com.maven.blog.model.Blog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BlogMapper {

    @Select("select * from blog where delete_flag = 0 ")
    List<Blog> selectAll();

    @Select("select * from blog where id =#{blogId} and delete_flag = 0 ")
    Blog selectById(Integer blogId);

    Integer updateBlog(Blog blog);

    @Insert("insert into blog(title,content,user_id) values(#{title},#{content},#{userId})")
    Integer insert(Blog blog);


}
